import { caller } from './caller'

export async function getJsApiTicket(access_token: string) {
    return caller
        .request<{
            ticket: string
            expires_in: number
        }>({
            method: 'GET',
            url: '/cgi-bin/ticket/getticket',
            params: {
                access_token,
                type: 'jsapi',
            },
        })
        .then((resp) => resp.data)
}
